package com.kawa.service;

import com.kawa.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.client.RestTemplate;

@Service
public class RibbonService {
    @Autowired
    private RestTemplate restTemplate;

    public String getUserbyId(Long id){
        return restTemplate.getForObject("http://eureka-client-provider/user/get/"+id,String.class);
    }

    public User add(User user){
        return restTemplate.postForObject("http://eureka-client-provider/user/add",user,User.class);
    }

}
